package com.github.chirspan.xaas.soa.message.processor;

import com.github.chirspan.xaas.soa.message.core.MessageModel;
import com.github.chirspan.xaas.soa.message.core.SOAMessage;
import com.github.chirspan.xaas.soa.message.schema.MessageSchemaDefinition;

public interface IMessageProcessor {

    String getMessageType();

    /**
     * 消息生成
     *
     * @param message
     * @param msd
     * @return
     */
    SOAMessage generate(MessageModel message,
                        MessageSchemaDefinition msd);

    /**
     * 消息解析
     *
     * @param message
     * @return
     * @throws Exception
     */
    MessageModel parse(SOAMessage message) throws Exception;
}
